package st.business.tepth.business.user.busnumber.workholder.maintain.work.content.standardwork.workdetail;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.DiagnoseBean;
import st.business.tepth.business.bean.MaintainWorkDetailBean;
import st.business.tepth.business.bean.PartLocationBean;
import st.business.tepth.business.bean.PickGoods;
import st.business.tepth.business.bean.PostDiagnoseWrapperBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-04-15 15:34
 */

public interface WorkDetailContract {
    interface View extends BaseView {
        void showData(MaintainWorkDetailBean workDetailBean);

        void showError(String msg);

        void postDiagnoseList(List<DiagnoseBean> list);

        void deleteDiagnose(int position);

        void deleteProgram(int position);

        void returnGoodsSucceed(int position);

        void showPickGoods(List<PickGoods> list);

        void pickGoodsSucceed();

        void commitValueSucceed();

        void showTempLocation(PartLocationBean partLocationBean, int position);
    }

    interface Model extends BaseModel {
        Disposable getDetailData(String token, int maintenanceId,
                                 OnDataConvertListener<MaintainWorkDetailBean> success);

        Disposable postDiagnoseList(String token, int repairId,
                                    int repairTaskId, int maintainId,
                                    String faultDiagnosticList,
                                    OnDataConvertListener<PostDiagnoseWrapperBean>
                                            success);

        Disposable deleteProgram(String token, int repairId,
                                 int faultDiagnosticId, int planId,
                                 OnDataConvertListener<String>
                                         listener);

        Disposable postProgram(final String token, final int repairId,
                               final int repairTaskId, int maintainId,
                               String taskItemList,
                               OnDataConvertListener<List<PickGoods>> pickListener,
                               OnDataConvertListener<MaintainWorkDetailBean>
                                       success);

        Disposable deleteDiagnose(String token, int repairId,
                                  int faultDiagnosticId,
                                  OnDataConvertListener<String>
                                          listener);

        Disposable returnGoods(String token, String items, int planId,
                               OnDataConvertListener<String> returnListener);

        Disposable pickGoods(String token, int maintenanceId, String materialApplyList,
                             OnDataConvertListener<String> pickListener,
                             OnDataConvertListener<MaintainWorkDetailBean> listener);

        Disposable commitMeasureValue(String token, int maintainId, String value,
                                      OnDataConvertListener<String> pickListener);

        Disposable addTempLocation(String token,
                                   String tempLocation,
                                   OnDataConvertListener<List<PartLocationBean>> listener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getDetailData(String token, int maintenanceId);

        abstract void confirmDiagnoseList(String token, int repairId,
                                          int repairTaskId, int maintainId,
                                          String faultDiagnosticList);

        abstract void deleteDiagnose(String token, int repairId,
                                     int faultDiagnosticId, int position);

        abstract void confirmProgram(final String token, final int repairId,
                                     final int repairTaskId, int maintainId,
                                     String taskItemList);

        abstract void deleteProgram(String token, int repairId,
                                    int faultDiagnosticId, int planId,
                                    int position);

        abstract void pickGoods(String token, int maintenanceId, String materialApplyList);

        abstract void returnGoods(String token, String items,
                                  int planId, int position);

        abstract void commitMeasureValue(String token, int maintainId, String value);

        abstract void addTempLocation(String token, int position,
                                      PartLocationBean partLocationBean,
                                      String tempLocation);
    }
}
